<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SemOpt: Grounded Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">SemOpt
   &#160;<span id="projectnumber">0.2alpha5-SCC</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classGrounded.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pri-static-methods">Static Private Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Grounded Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="Grounded" -->
<p>The class compute the <a class="el" href="classGrounded.html" title="The class compute the Grounded Algorithm.">Grounded</a> Algorithm.  
 <a href="classGrounded.html#details">More...</a></p>

<p><a href="classGrounded-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGrounded.html#a7825cea0732284e135768d4d25283b42">doGrounded</a> (<a class="el" href="classSetArguments.html">SetArguments</a> gamma, <a class="el" href="classSetArguments.html">SetArguments</a> C, <a class="el" href="classSetArguments.html">SetArguments</a> *e, <a class="el" href="classSetArguments.html">SetArguments</a> *I)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the <a class="el" href="classGrounded.html" title="The class compute the Grounded Algorithm.">Grounded</a> Algorithm.  <a href="#a7825cea0732284e135768d4d25283b42"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pri-static-methods"></a>
Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGrounded.html#a20b4011b5fa1a6f423708f8d293b7630">isNempty</a> (<a class="el" href="classSetArguments.html">SetArguments</a> *, <a class="el" href="classSetArguments.html">SetArguments</a> *, <a class="el" href="classSetArguments.html">SetArguments</a> *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">computes N and verify that it is empty  <a href="#a20b4011b5fa1a6f423708f8d293b7630"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classGrounded.html#ac70689c14c7e88b07598e0d66c0eda56">computeNSet</a> (<a class="el" href="classSetArguments.html">SetArguments</a> *C, <a class="el" href="classSetArguments.html">SetArguments</a> *I, <a class="el" href="classSetArguments.html">SetArguments</a> *N)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">computes the set where all the nodes in it are in C and are not attacked by no nodes in I  <a href="#ac70689c14c7e88b07598e0d66c0eda56"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The class compute the <a class="el" href="classGrounded.html" title="The class compute the Grounded Algorithm.">Grounded</a> Algorithm. </p>
<p>The class allows the developer to compute the <a class="el" href="classGrounded.html" title="The class compute the Grounded Algorithm.">Grounded</a> Algorithm. This Algorithm is mainly used in the Pref() method of the class PrefAlgorithm. The main mathod of this class, as the developer can imagine, is <a class="el" href="classGrounded.html#a7825cea0732284e135768d4d25283b42" title="Computes the Grounded Algorithm.">doGrounded()</a> that compute the grounded outputs: see the documentation of <a class="el" href="classGrounded.html#a7825cea0732284e135768d4d25283b42" title="Computes the Grounded Algorithm.">doGrounded()</a> to understand the grounded Algorithm.</p>
<dl class="date"><dt><b>Date:</b></dt><dd>Aug 25, 2013 </dd></dl>
<dl class="author"><dt><b>Author:</b></dt><dd>koldar </dd></dl>

<p>Definition at line <a class="el" href="Grounded_8h_source.html#l00013">13</a> of file <a class="el" href="Grounded_8h_source.html">Grounded.h</a>.</p>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac70689c14c7e88b07598e0d66c0eda56"></a><!-- doxytag: member="Grounded::computeNSet" ref="ac70689c14c7e88b07598e0d66c0eda56" args="(SetArguments *C, SetArguments *I, SetArguments *N)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classGrounded.html#ac70689c14c7e88b07598e0d66c0eda56">Grounded::computeNSet</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>C</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>I</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>N</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>computes the set where all the nodes in it are in C and are not attacked by no nodes in I </p>
<p>The function retrieve all the nodes in C which are not attacked by any nodes in I. This function is useful in the function <a class="el" href="classGrounded.html#a20b4011b5fa1a6f423708f8d293b7630" title="computes N and verify that it is empty">isNempty()</a>. The figure makes the mechanism of the function clearer: </p>
<ul>
<li>red are nodes in C; </li>
<li>yellow are nodes in I; </li>
<li>orange are nodes both in C and in I;</li>
</ul>
<p>The solution N in this case would be {a,b,c,d,h,j,k,l}</p>
<div align="center">
<img src="dot_inline_dotgraph_2.png" alt="dot_inline_dotgraph_2.png" border="0" usemap="#dot_inline_dotgraph_2.map"/>
<map name="dot_inline_dotgraph_2.map" id="dot_inline_dotgraph_2.map"></map>
</div>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>N initialized correctly through a constructor; </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>N is storing all the solution nodes</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">C</td><td>the set containing all the nodes in the output </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">I</td><td>the set that attacks some nodes in C </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">N</td><td>all the nodes in C which are not attacked by any nodes in I </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="Grounded_8cpp_source.html#l00168">168</a> of file <a class="el" href="Grounded_8cpp_source.html">Grounded.cpp</a>.</p>

<p>References <a class="el" href="SetArguments_8cpp_source.html#l00056">SetArguments::add_Argument()</a>, <a class="el" href="SetArguments_8cpp_source.html#l00103">SetArguments::begin()</a>, <a class="el" href="SetArguments_8cpp_source.html#l00094">SetArguments::empty()</a>, and <a class="el" href="SetArguments_8cpp_source.html#l00112">SetArguments::end()</a>.</p>

<p>Referenced by <a class="el" href="Grounded_8cpp_source.html#l00104">isNempty()</a>.</p>

</div>
</div>
<a class="anchor" id="a7825cea0732284e135768d4d25283b42"></a><!-- doxytag: member="Grounded::doGrounded" ref="a7825cea0732284e135768d4d25283b42" args="(SetArguments gamma, SetArguments C, SetArguments *e, SetArguments *I)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classGrounded.html#a7825cea0732284e135768d4d25283b42">Grounded::doGrounded</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a>&#160;</td>
          <td class="paramname"><em>G</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a>&#160;</td>
          <td class="paramname"><em>C</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>e</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>I</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Computes the <a class="el" href="classGrounded.html" title="The class compute the Grounded Algorithm.">Grounded</a> Algorithm. </p>
<p>The grounded algorithm can be synthetized as this pseudo-code:</p>
<div class="fragment"><pre class="fragment">        e &lt;- emptySet
        I &lt;- A
        <span class="keywordflow">while</span> (exists N subset or equal to C containing only nodes which are not attacked by nodes in I) <span class="keywordflow">do</span>
                e &lt;- e <span class="keyword">union </span>N
                ANC &lt;- C subset containing  all nodes which are attacked by nodes in N
                ANI &lt;- I subset containing all nodes which are attacked by nodes in N
                C &lt;- C\(N union ANC)
                I &lt;- I\(N union ANI)
        return (e,I)
</pre></div><dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>C must be a subset of G; </li>
<li>e must be already be initialized through a constructor; </li>
<li>I must be already be initialized through a constructor; </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>in e some nodes have been added; </li>
<li>in I some nodes have been added;</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">G</td><td>represents the graph where grounded algorithm must be computed; </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">C</td><td>the graph to be groundized. C has to be a subset of G: $C  G$; </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">e</td><td>an output of the function </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">I</td><td>an output of the function </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="Grounded_8cpp_source.html#l00046">46</a> of file <a class="el" href="Grounded_8cpp_source.html">Grounded.cpp</a>.</p>

<p>References <a class="el" href="SetArguments_8cpp_source.html#l00415">SetArguments::getSubsetAttackedBy()</a>, <a class="el" href="Grounded_8cpp_source.html#l00104">isNempty()</a>, <a class="el" href="SetArguments_8cpp_source.html#l00817">SetArguments::merge()</a>, and <a class="el" href="SetArguments_8cpp_source.html#l00306">SetArguments::setminus()</a>.</p>

</div>
</div>
<a class="anchor" id="a20b4011b5fa1a6f423708f8d293b7630"></a><!-- doxytag: member="Grounded::isNempty" ref="a20b4011b5fa1a6f423708f8d293b7630" args="(SetArguments *, SetArguments *, SetArguments *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classGrounded.html#a20b4011b5fa1a6f423708f8d293b7630">Grounded::isNempty</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>C</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>I</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classSetArguments.html">SetArguments</a> *&#160;</td>
          <td class="paramname"><em>N</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>computes N and verify that it is empty </p>
<p>Function used in the algorithm <a class="el" href="classGrounded.html#a7825cea0732284e135768d4d25283b42" title="Computes the Grounded Algorithm.">doGrounded()</a> to compute easily N and test wether or not it is empty.</p>
<dl class="pre"><dt><b>Precondition:</b></dt><dd><ul>
<li>N must be initialized through a constructor successfully; </li>
</ul>
</dd></dl>
<dl class="post"><dt><b>Postcondition:</b></dt><dd><ul>
<li>N is filled.</li>
</ul>
</dd></dl>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">C</td><td>The set C </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">I</td><td>the set I </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">N</td><td>the subset of C which is attacked by any nodes present in I </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if N is empty, FALSE otherwise </dd></dl>

<p>Definition at line <a class="el" href="Grounded_8cpp_source.html#l00104">104</a> of file <a class="el" href="Grounded_8cpp_source.html">Grounded.cpp</a>.</p>

<p>References <a class="el" href="Grounded_8cpp_source.html#l00168">computeNSet()</a>, and <a class="el" href="SetArguments_8cpp_source.html#l00094">SetArguments::empty()</a>.</p>

<p>Referenced by <a class="el" href="Grounded_8cpp_source.html#l00046">doGrounded()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="Grounded_8h_source.html">Grounded.h</a></li>
<li>src/<a class="el" href="Grounded_8cpp_source.html">Grounded.cpp</a></li>
</ul>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="classGrounded.html">Grounded</a>      </li>

    <li class="footer">Generated on Fri Jan 17 2014 11:47:52 for SemOpt by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
